#!/bin/bash

#g_Sh_Cross_Tool=aarch64-linux-gnu-

rm libmqttclient.sh
./MqttClient/make-libmqttclient.sh $g_Sh_Cross_Tool
cp MqttClient/libmqttclient/lib/libmqttclient.so ./
$g_Sh_Cross_Tool'gcc' *.c -o mqtt_demo -I MqttClient/libmqttclient/include -L MqttClient/libmqttclient/lib -lmqttclient -lm -lpthread
if [ $? -eq 0 ] ; then
    echo -e "\033[40;36mmake success\033[0m"
    $g_Sh_Cross_Tool'strip' mqtt_demo
else
    echo -e "\033[40;31mmake error\033[0m"
fi
